package main

import "fmt"
type user struct{
	id int
	username string
	email string
}
type admin struct{
	user user
	allowLogin bool
}

func (u user)notify(){
	fmt.Printf("send email to %s<%s>\n",u.username,u.email)
}

func (u *user) changeEmail(email string){
	u.email = email
}

func main()  {

	newUser  := user{1,"zhangshan","zhangs@126.com"}
	newUser.notify()
	newUser.changeEmail("test@126.com")
	newUser.notify()
	//fmt.Println(newUser)

	//newAdmin := admin{user:newUser,allowLogin:true}
	//fmt.Println(newAdmin)


}
